package apps.softtech.fastmarket.model;

import android.content.ContentValues;
import android.database.Cursor;

public class FollowProduct {

	public static final String TABLE_NAME = "FollowProduct";

	public static final String FOLLOW_ID = "st_FollowId";
	private int followId;

	public static final String USERID = "st_UserId";
	private int userId;

	public static final String PRODUCT_ID = "st_ProductId";
	private int productId;

	public static final String FOLLOW_DATE = "st_FollowDate";
	private String followDate;

	public static final String GET_NOTIFICATION = "st_GetNotification";
	private int getNotificaton;

	public static final String UNFOLLOW = "st_Unfollow";
	private int unFollow;

	public FollowProduct() {
		super();
	}

	public FollowProduct(int followProductId, int userId, int productId,
			String followDate, int getNotificaton, int unFollow) {
		super();
		this.followId = followProductId;
		this.userId = userId;
		this.productId = productId;
		this.followDate = followDate;
		this.getNotificaton = getNotificaton;
		this.unFollow = unFollow;
	}

	public FollowProduct(int userId, int productId, String followDate,
			int getNotificaton , int unFollow) {
		super();
		this.userId = userId;
		this.productId = productId;
		this.followDate = followDate;
		this.getNotificaton = getNotificaton;
		this.unFollow = unFollow;
	}

	/**
	 * get ContentValues of FollowProduct
	 * 
	 * @return ContentValues
	 */
	public ContentValues getValueFollowProduct() {
		ContentValues values = new ContentValues();
		values.put(USERID, this.getUserId());
		values.put(PRODUCT_ID, this.getProductId());
		values.put(FOLLOW_DATE, this.getFollowDate());
		values.put(GET_NOTIFICATION, this.getNotificaton);
		return values;
	}

	public void setValueFromCursor(Cursor c) {

		if (c.getColumnIndex(FOLLOW_ID) >= 0) {
			setFollowProductId(c.getInt(c.getColumnIndex(FOLLOW_ID)));
		}
		if (c.getColumnIndex(FOLLOW_DATE) >= 0) {
			setFollowDate(c.getString(c.getColumnIndex(FOLLOW_DATE)));
		}
		if (c.getColumnIndex(PRODUCT_ID) >= 0) {
			setProductId(c.getInt(c.getColumnIndex(PRODUCT_ID)));
		}
		if (c.getColumnIndex(USERID) >= 0) {
			setUserId(c.getInt(c.getColumnIndex(USERID)));
		}
		if (c.getColumnIndex(GET_NOTIFICATION) >= 0) {
			setGetNotificaton(c.getInt(c.getColumnIndex(GET_NOTIFICATION)));
		}
	}

	public int getUnFollow() {
		return unFollow;
	}

	public void setUnFollow(int unFollow) {
		this.unFollow = unFollow;
	}

	public int getFollowProductId() {
		return followId;
	}

	public void setFollowProductId(int followProductId) {
		this.followId = followProductId;
	}

	public int getUserId() {
		return userId;
	}

	public void setUserId(int userId) {
		this.userId = userId;
	}

	public int getProductId() {
		return productId;
	}

	public void setProductId(int productId) {
		this.productId = productId;
	}

	public String getFollowDate() {
		return followDate;
	}

	public void setFollowDate(String followDate) {
		this.followDate = followDate;
	}

	public int getGetNotificaton() {
		return getNotificaton;
	}

	public void setGetNotificaton(int getNotificaton) {
		this.getNotificaton = getNotificaton;
	}
}
